package com.niiwoo.civet.account.enums;

import java.util.Arrays;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 激活开户订单状态
 */
@AllArgsConstructor
@Getter
public enum ActivateAccountOrderStatusEnum {


    PROCESSING((byte) 1, "处理中"),
    SUCCESS((byte) 2, "成功"),
    FAILURE((byte) 3, "失败"),
    AUDITING((byte) 4, "审核中"),
    AUDIT_RETURN((byte) 5, "审核退回"),
    AUDIT_REJECT((byte) 6, "审核拒绝");

    private final Byte value;
    private final String desc;

    public static ActivateAccountOrderStatusEnum of(Byte value) {
        if (value != null) {
            for (ActivateAccountOrderStatusEnum s : values()) {
                if (s.value.equals(value)) {
                    return s;
                }
            }
        }
        return null;
    }

    public static boolean except(Byte value, ActivateAccountOrderStatusEnum... status) {
        return (status != null && status.length > 0) && Arrays.asList(status).contains(of(value));
    }


}
